home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 414_02 / private / _addtail.c next >
Encoding:
C/C++ Source or Header  |  1993-06-17  |  1.4 KB  |  63 lines

  1. #define    CURSES_LIBRARY    1
  2. #include <curses.h>
  3.  
  4. #ifdef    REGISTERWINDOWS
  5. #ifdef PDCDEBUG
  6. char *rcsid__addtail = "$Header: C:\CURSES\private\RCS\_addtail.c 2.1 1993/06/18 20:23:05 MH Rel MH $";
  7. #endif
  8.  
  9.  
  10.  
  11.  
  12. /*man-start*********************************************************************
  13.  
  14.   PDC_addtail()    - add window to the visible window list
  15.  
  16.   PDCurses Description:
  17.      This is a private PDCurses function.
  18.  
  19.      This routine adds the passed window pointer to the end fo the
  20.      visible window list.  All windows on this list will automatically
  21.      be refreshed if _cursvar.refreshall is true.
  22.  
  23.   PDCurses Return Value:
  24.      This function returns OK upon success otherwise ERR is returned.
  25.  
  26.   PDCurses Errors:
  27.      It is an error to pass a NULL window pointer.
  28.  
  29.   Portability:
  30.      PDCurses    int    PDC_addtail( WINDOW* tail );
  31.  
  32. **man-end**********************************************************************/
  33.  
  34. int    PDC_addtail(WINDOW *tail)
  35. {
  36.     WINDS  *next = _cursvar.visible;
  37.  
  38. #ifdef PDCDEBUG
  39.     if (trace_on) PDC_debug("PDC_addtail() - called\n");
  40. #endif
  41.  
  42.     if  (tail == (WINDOW *)NULL)
  43.         return( ERR );
  44.  
  45.     while (next != (WINDS *)NULL)
  46.     {
  47.         if (next->next == NULL)
  48.             break;
  49.         next = next->next;
  50.     }
  51.     if (next == NULL)
  52.         PDC_inswin(tail, (WINDOW *)NULL);
  53.     else
  54.     {
  55.         if (next->w == NULL)
  56.             PDC_inswin(tail, (WINDOW *)NULL);
  57.         else
  58.             PDC_addwin(tail, next->w);
  59.     }
  60.     return( OK );
  61. }
  62. #endif
  63.